import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/center',
    name: 'center',
    redirect: '/',
    component: () => import('@/views/center.vue'),
    children: [
      {
        path: '/',
        name: 'index',
        component: () => import('@/views/index.vue'),
      },
      {
        path: '/openApi',
        name: 'openApi',
        component: () => import('@/views/openApi.vue'),
      },
    ],
  },
  {
    path: '/:pathMatch(.*)*',
    name: '404',
    component: () => import('@/views/404.vue'),
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
})

export default router
